//详情页面
import { NavLink, Redirect, Route, Switch } from 'react-router-dom'
import React from 'react'
import Child from './Child'
import Childnth from './Childnth'
import NotFound from '../error/NotFound'

function Detail () {
    let stylesheet = {
        padding: 5 + 'px'
    }
    return (<div className="detail">
        <h1>详情页面</h1>
        <Switch>
            <Redirect from="/detail" to="/detail/path1" exact/>
            <Route path="/detail/path1" component={Child}>{}</Route>
            <Route path="/detail/path2" component={Childnth}>{}</Route>
            <Route path="*" component={NotFound}>{}</Route>
        </Switch>
        <NavLink to="/detail/path1" style={stylesheet}>子页面1</NavLink>
        <NavLink to="/detail/path2">子页面2</NavLink>
    </div>)
}

export default Detail
